﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameBase;
using Microsoft.Xna.Framework;

namespace GalaxyPresident
{
    public abstract class ExploitBuilding : OwnEntity
    {
        protected float numberOfExploit;
        protected float percentAccending = 0;
        protected bool isStartExploit = false;

        public override string getObjectName()
        {
            return "ExploitBuilding";
        }

        public ExploitBuilding(Planet planet)
            : base(planet)
        {
        }

        public override void UpdateInfo(GameTime gameTime)
        {
            base.UpdateInfo(gameTime);

            if (isStartExploit)
            {
                _currentTotalTime += gameTime.ElapsedGameTime.Milliseconds;
                if (_currentTotalTime >= 250)
                {
                    _currentTotalTime = 0;
                    increaseResources();
                }
            }
        }

        protected virtual void increaseResources()
        {
            
        }

        public override void startUpdatePlanetInfo()
        {
            isStartExploit = true;
        }

        public override string getInfoString()
        {
            return base.getInfoString() +
                  "\nLevel   : " + (level+1).ToString()
                + "\nYield   : " + numberOfExploit.ToString();
        }
    }
}
